# $1 pre or suf
# $2 str
# $3 add or del

# for files in `ls *`;do mv ${files} ${files}.aaa;done
# for files in `ls *`;do mv $files `echo $files | sed 's/aaa//'`;done
if [[ "$1" == "pre" ]];then
	if [[ "$3" == "add" ]];then
		for files in `ls *`
		do
			mv ${files} $2${files}
		done
	else 
		for files in `ls *`
		do
			mv ${files} `echo $files | sed `s/^$2//``
		done
	fi
else
	if [[ "$3" == "add" ]];then
		for files in `ls *`
		do
			mv ${files} ${files}$2
		done
	else 
		for files in `ls *`
		do
			mv ${files} `echo $files | sed `s/$2//``
		done
	fi
fi
